import {
  createRouter,
  createWebHistory
} from 'vue-router'
const childrenRouter = [{
    path: '/',
    name: 'default',
    component: () => import('@/views/index/index.vue'),
  },
  {
    path: '/index',
    name: 'index',
    component: () => import( /* webpackChunkName: "index" */ '../views/index/index.vue')
  },

]
const routes = [{
    path: '/',
    name: 'layout',
    component: () => import('@/views/layout/index.vue'),
    children: childrenRouter,
    meta: {
      title: '首页'
    }
  },
  {
    path: '/login',
    name: 'login',
    component: () => import( /* webpackChunkName: "index" */ '../views/login/index.vue')
  },

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router